﻿using Hong.Model.SysDomain.Model_AssessmentManagement;
using Hong.Model.SysDomain.Model_AttendanceManagement;
using Hong.Model.SysDomain.Model_ContractManagement;
using Hong.Model.SysDomain.Model_CustomerManagement;
using Hong.Model.SysDomain.Model_LeadingCockpitManagement;
using Hong.Model.SysDomain.Model_OperationManagement;
using Hong.Model.SysDomain.Model_SystemSettings;
using Hong.Model.SysDomain.Model_SystemSettings.RBAC;
using Microsoft.EntityFrameworkCore;

#nullable disable

namespace Hong.Repository.Data
{
    public partial class T_HongShi_3Context : DbContext
    {
        public T_HongShi_3Context()
        {
        }
      
        public T_HongShi_3Context(DbContextOptions<T_HongShi_3Context> options)
            : base(options)
        {
        }

        public virtual DbSet<Accessory> Accessories { get; set; }
        public virtual DbSet<Address> Addresses { get; set; }
        public virtual DbSet<AssClass> AssClasses { get; set; }
        public virtual DbSet<AssSmaliProjec> AssSmaliProjecs { get; set; }
        public virtual DbSet<AssessmentList> AssessmentLists { get; set; }
        public virtual DbSet<AssessmentPrjec> AssessmentPrjecs { get; set; }
        public virtual DbSet<BuildingTypeInfo> BuildingTypeInfos { get; set; }
        public virtual DbSet<Compare> Compares { get; set; }
        public virtual DbSet<ContractInfo> ContractInfos { get; set; }
        public virtual DbSet<ContractDept> ContractDepts { get; set; }
        public virtual DbSet<ContractrateInfo> ContractrateInfos { get; set; }
        public virtual DbSet<Customer> Customers { get; set; }
        public virtual DbSet<Department> Departments { get; set; }
        public virtual DbSet<Dictionary> Dictionaries { get; set; }
        public virtual DbSet<DeptContract> DeptContracts { get; set; }
        public virtual DbSet<Extended> Extendeds { get; set; }
        public virtual DbSet<InstantiationInfo> InstantiationInfos { get; set; }
        public virtual DbSet<MenudInfo> MenudInfos { get; set; }
        public virtual DbSet<NodeInfo> NodeInfos { get; set; }
        public virtual DbSet<Person> People { get; set; }
        public virtual DbSet<Personne> Personnes { get; set; }
        public virtual DbSet<Personnel> Personnel { get; set; }
        public virtual DbSet<ProCon> ProCons { get; set; }
        public virtual DbSet<Project> Projects { get; set; }
        public virtual DbSet<ProjectType> ProjectTypes { get; set; }
        public virtual DbSet<ProjectDuibi> ProjectDuibis { get; set; }
        public virtual DbSet<RecordInfo> RecordInfos { get; set; }
        public virtual DbSet<RequestInfo> RequestInfos { get; set; }
        public virtual DbSet<RoleMenud> RoleMenuds { get; set; }
        public virtual DbSet<Roleinfo> Roleinfos { get; set; }
        public virtual DbSet<Satisfaction> Satisfactions { get; set; }
        public virtual DbSet<StructuralstyleInfo> StructuralstyleInfos { get; set; }
        public virtual DbSet<UserRole> UserRoles { get; set; }
        public virtual DbSet<NPer> NPers { get; set; }
        public virtual DbSet<Notice> Notices { get; set; }

        public virtual DbSet<AssProgress> AssProgresses { get; set; }
        public virtual DbSet<AssBonu> AssBonus { get; set; }
        public virtual DbSet<Bonuscalculation> Bonuscalculations { get; set; }
        public virtual DbSet<HolidaysInfo> HolidaysInfos { get; set; }
        public virtual DbSet<WorkdayInfo> WorkdayInfos { get; set; }
        public virtual DbSet<BonuscalculationS1> BonuscalculationS1s { get; set; }
        public virtual DbSet<BonusDetail> BonusDetails { get; set; }
        public virtual DbSet<Annualdistribution> Annualdistributions { get; set; }
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            if (!optionsBuilder.IsConfigured)
            {
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
                optionsBuilder.UseSqlServer("Data Source=10.31.60.15;Initial Catalog=T_HongShi_3;Persist Security Info=True;User ID=sa;Pwd=123456");
            }
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.HasAnnotation("Relational:Collation", "Chinese_PRC_CI_AS");

            modelBuilder.Entity<Annualdistribution>(entity =>
            {
                entity.HasKey(e => e.AnnId)
                    .HasName("PK__Annualdi__1C67F94B9BAB88A9");

                entity.ToTable("Annualdistribution");

                entity.Property(e => e.AnnAdvance).HasColumnType("decimal(18, 0)");

                entity.Property(e => e.AnnBim)
                    .HasColumnType("decimal(18, 0)")
                    .HasColumnName("AnnBIM");

                entity.Property(e => e.AnnBonus).HasColumnType("decimal(18, 0)");

                entity.Property(e => e.AnnBonuswithin).HasColumnType("decimal(18, 0)");

                entity.Property(e => e.AnnCalculated).HasColumnType("decimal(18, 0)");

                entity.Property(e => e.AnnCompany).HasColumnType("decimal(18, 0)");

                entity.Property(e => e.AnnDepartment).HasColumnType("decimal(18, 0)");

                entity.Property(e => e.AnnExcellent).HasColumnType("decimal(18, 0)");

                entity.Property(e => e.AnnManagement).HasColumnType("decimal(18, 0)");

                entity.Property(e => e.AnnName).HasMaxLength(50);

                entity.Property(e => e.AnnOutstanding).HasColumnType("decimal(18, 0)");

                entity.Property(e => e.AnnProject).HasColumnType("decimal(18, 0)");

                entity.Property(e => e.AnnRegistration).HasColumnType("decimal(18, 0)");

                entity.Property(e => e.AnnTrade).HasColumnType("decimal(18, 0)");

                entity.Property(e => e.Anntotal1).HasColumnType("decimal(18, 0)");

                entity.Property(e => e.Anntotal2).HasColumnType("decimal(18, 0)");

                entity.Property(e => e.AssId).HasMaxLength(50);
            });

            modelBuilder.Entity<BonusDetail>(entity =>
            {
                entity.HasKey(e => e.Bdid)
                    .HasName("PK__BonusDet__3EFE4173535DAFB9");

                entity.Property(e => e.Bdid).HasColumnName("BDId");

                entity.Property(e => e.AssId).HasMaxLength(50);

                entity.Property(e => e.Bdstart).HasColumnName("BDstart");
            });

            modelBuilder.Entity<BonuscalculationS1>(entity =>
            {
                entity.HasKey(e => e.Bid)
                    .HasName("PK__Bonuscal__C6DE0CC140BAF259");

                entity.ToTable("BonuscalculationS1");

                entity.Property(e => e.Bid).HasColumnName("BId");

                entity.Property(e => e.AssId).HasMaxLength(50);

                entity.Property(e => e.Badjustment).HasColumnType("decimal(18, 2)");

                entity.Property(e => e.BadjustmentValue).HasColumnType("decimal(18, 2)");

                entity.Property(e => e.Badvancebonus)
                    .HasColumnType("decimal(18, 2)")
                    .HasColumnName("BAdvancebonus");

                entity.Property(e => e.Basepay).HasColumnType("decimal(18, 2)");

                entity.Property(e => e.BavgMounth)
                    .HasColumnType("decimal(18, 2)")
                    .HasColumnName("BAvgMounth");

                entity.Property(e => e.Baward)
                    .HasColumnType("decimal(18, 2)")
                    .HasColumnName("BAward");

                entity.Property(e => e.Bdifference1)
                    .HasColumnType("decimal(18, 2)")
                    .HasColumnName("BDifference1");

                entity.Property(e => e.Bdifference2)
                    .HasColumnType("decimal(18, 2)")
                    .HasColumnName("BDifference2");

                entity.Property(e => e.Bevaluation)
                    .HasColumnType("decimal(18, 2)")
                    .HasColumnName("BEvaluation");

                entity.Property(e => e.Bfirsthalf)
                    .HasColumnType("decimal(18, 2)")
                    .HasColumnName("BFirsthalf");

                entity.Property(e => e.Bmutual)
                    .HasColumnType("decimal(18, 2)")
                    .HasColumnName("BMutual");

                entity.Property(e => e.Bname)
                    .HasMaxLength(50)
                    .HasColumnName("BName");

                entity.Property(e => e.BonusValue).HasColumnType("decimal(18, 2)");

                entity.Property(e => e.Border1).HasColumnName("BOrder1");

                entity.Property(e => e.Border2).HasColumnName("BOrder2");

                entity.Property(e => e.Bsecondhalf).HasColumnType("decimal(18, 2)");

                entity.Property(e => e.Btotal1).HasColumnType("decimal(18, 2)");

                entity.Property(e => e.Btotal2).HasColumnType("decimal(18, 2)");

                entity.Property(e => e.Bwagemultiple)
                    .HasColumnType("decimal(18, 2)")
                    .HasColumnName("BWagemultiple");

                entity.Property(e => e.Bweighting).HasColumnType("decimal(18, 2)");

                entity.Property(e => e.Bworkinghours).HasColumnType("decimal(18, 2)");
            });

            modelBuilder.Entity<Bonuscalculation>(entity =>
            {
                entity.HasKey(e => e.CulaId)
                    .HasName("PK__Bonuscal__744AC9D8758594E8");

                entity.ToTable("Bonuscalculation");

                entity.Property(e => e.AssId).HasMaxLength(50);

                entity.Property(e => e.CulaAchie).HasColumnType("decimal(18, 2)");

                entity.Property(e => e.CulaAge).HasColumnType("decimal(18, 2)");

                entity.Property(e => e.CulaDepBouns).HasColumnType("decimal(18, 2)");

                entity.Property(e => e.CulaProjectbonus).HasColumnType("decimal(18, 2)");

                entity.Property(e => e.CulaProporbonus).HasColumnType("decimal(18, 2)");

                entity.Property(e => e.CulaProportion).HasColumnType("decimal(18, 2)");

                entity.Property(e => e.CulaSum).HasColumnType("decimal(18, 2)");

                entity.Property(e => e.Culamultiple).HasColumnType("decimal(18, 2)");
            });

            modelBuilder.Entity<AssBonu>(entity =>
            {
                entity.HasKey(e => e.BounsId)
                    .HasName("PK__AssBonus__D8090E007934ABAA");

                entity.Property(e => e.AssId).HasMaxLength(50);

                entity.Property(e => e.BounAdjustment).HasColumnType("decimal(18, 0)");

                entity.Property(e => e.Bouncalculation).HasColumnType("decimal(18, 0)");

                entity.Property(e => e.PersonnelId).HasMaxLength(100);
            });

            modelBuilder.Entity<AssProgress>(entity =>
            {
                entity.HasKey(e => e.ProId)
                    .HasName("PK__AssProgr__6202959096301F87");

                entity.ToTable("AssProgress");

                entity.Property(e => e.ProAppliance).HasMaxLength(50);

                entity.Property(e => e.ProAssProId).HasMaxLength(50);

                entity.Property(e => e.ProChief1).HasMaxLength(50);

                entity.Property(e => e.ProChief2).HasMaxLength(50);

                entity.Property(e => e.ProConstruction).HasMaxLength(50);

                entity.Property(e => e.ProDivision1).HasMaxLength(50);

                entity.Property(e => e.ProDivision2).HasMaxLength(50);

                entity.Property(e => e.ProDivision3).HasMaxLength(50);

                entity.Property(e => e.ProDivision4).HasMaxLength(50);

                entity.Property(e => e.ProDivision5).HasMaxLength(50);

                entity.Property(e => e.ProDivision6).HasMaxLength(50);

                entity.Property(e => e.ProDrainage).HasMaxLength(50);

                entity.Property(e => e.ProHost).HasMaxLength(50);

                entity.Property(e => e.ProHvac)
                    .HasMaxLength(50)
                    .HasColumnName("ProHVAC");

                entity.Property(e => e.ProStructure).HasMaxLength(50);
            });

            modelBuilder.Entity<Accessory>(entity =>
            {
                entity.HasKey(e => e.AcsoryId);

                entity.ToTable("Accessory");

                entity.Property(e => e.AcsoryId)
                    .HasMaxLength(50)
                    .HasColumnName("acsoryId");

                entity.Property(e => e.AcsoryIdNmae)
                    .HasMaxLength(50)
                    .HasColumnName("acsoryIdNmae");

                entity.Property(e => e.AcsoryIdSize)
                    .HasMaxLength(50)
                    .HasColumnName("acsoryIdSize");

                entity.Property(e => e.AcsoryIdTime)
                    .HasColumnType("datetime")
                    .HasColumnName("acsoryIdTime");

                entity.Property(e => e.AcsoryIdType)
                    .HasMaxLength(50)
                    .HasColumnName("acsoryIdType");

                entity.Property(e => e.AcsoryIdUser)
                    .HasMaxLength(50)
                    .HasColumnName("acsoryIdUser");

                entity.Property(e => e.CustomerId)
                    .HasMaxLength(50)
                    .HasColumnName("customerId");
            });

            modelBuilder.Entity<Address>(entity =>
            {
                entity.ToTable("Address");

                entity.Property(e => e.AddressId)
                    .HasMaxLength(50)
                    .HasColumnName("addressId");

                entity.Property(e => e.AddressName)
                    .HasMaxLength(50)
                    .HasColumnName("addressName");

                entity.Property(e => e.AddressToupperId)
                    .HasMaxLength(50)
                    .HasColumnName("addressToupperId");
            });

            modelBuilder.Entity<AssClass>(entity =>
            {
                entity.HasKey(e => e.ClassId)
                    .HasName("PK__AssClass__CB1927C00B0DCD7B");

                entity.ToTable("AssClass");

                entity.Property(e => e.ClassDifficulty).HasColumnType("decimal(18, 0)");

                entity.Property(e => e.ClassFictitious).HasColumnType("decimal(18, 0)");

                entity.Property(e => e.ClassScale).HasColumnType("decimal(18, 0)");
            });

            modelBuilder.Entity<AssSmaliProjec>(entity =>
            {
                entity.HasKey(e => e.PrId)
                    .HasName("PK__AssSmali__A5021AAF3CDA4842");

                entity.ToTable("AssSmaliProjec");

                entity.Property(e => e.AssPrjectId).HasMaxLength(50);

                entity.Property(e => e.PrName).HasMaxLength(50);

                entity.Property(e => e.PrNote).HasMaxLength(50);
            });

            modelBuilder.Entity<AssessmentList>(entity =>
            {
                entity.HasKey(e => e.AssId)
                    .HasName("PK__Assessme__44ABB01ED8FD1EC3");

                entity.ToTable("AssessmentList");

                entity.Property(e => e.AssId).HasMaxLength(50);

                entity.Property(e => e.AssAvgWages)
                    .HasColumnType("decimal(18, 0)")
                    .HasDefaultValueSql("((0.00))");

                entity.Property(e => e.AssBeiZhu).HasMaxLength(50);

                entity.Property(e => e.AssCreateTime).HasColumnType("datetime");

                entity.Property(e => e.AssDepartment).HasMaxLength(50);

                entity.Property(e => e.AssEndTime).HasColumnType("datetime");

                entity.Property(e => e.AssEntry)
                    .HasColumnType("decimal(18, 0)")
                    .HasDefaultValueSql("((0.00))");

                entity.Property(e => e.AssProject).HasMaxLength(50);

                entity.Property(e => e.AssStartTime).HasColumnType("datetime");

                entity.Property(e => e.AssTotalWages)
                    .HasColumnType("decimal(18, 0)")
                    .HasDefaultValueSql("((0.00))");

                entity.Property(e => e.AssValue)
                    .HasColumnType("decimal(18, 0)")
                    .HasDefaultValueSql("((0.00))");
            });

            modelBuilder.Entity<AssessmentPrjec>(entity =>
            {
                entity.HasKey(e => e.AssPrjectId)
                    .HasName("PK__Assessme__75B4431F6065DA3D");

                entity.ToTable("AssessmentPrjec");

                entity.Property(e => e.AssPrjectId).HasMaxLength(50);

                entity.Property(e => e.AssPrjectListId).HasMaxLength(50);

                entity.Property(e => e.AssPrjectName).HasMaxLength(50);

                entity.Property(e => e.AssPrjectPartState).HasMaxLength(50);
            });

            modelBuilder.Entity<BuildingTypeInfo>(entity =>
            {
                entity.HasKey(e => e.BuildingType)
                    .HasName("PK__Building__F63874A58B2A1CBE");

                entity.ToTable("BuildingTypeInfo");

                entity.Property(e => e.BuildingType).HasColumnName("buildingType");

                entity.Property(e => e.BuildingTypeName)
                    .HasMaxLength(100)
                    .HasColumnName("buildingTypeName");
            });

            modelBuilder.Entity<Compare>(entity =>
            {
                entity.ToTable("Compare");

                entity.Property(e => e.AimValue).HasColumnType("decimal(18, 0)");

                entity.Property(e => e.DepartmentId)
                    .HasMaxLength(50)
                    .IsUnicode(false);

                entity.Property(e => e.Month).HasColumnType("decimal(18, 0)");

                entity.Property(e => e.ReducedValue).HasColumnType("decimal(18, 0)");

                entity.Property(e => e.Target).HasColumnType("decimal(18, 0)");

                entity.Property(e => e.Year).HasColumnType("decimal(18, 0)");
            });

            modelBuilder.Entity<ContractInfo>(entity =>
            {
                entity.HasKey(e => e.ContractId)
                    .HasName("PK_CONTRACTINFO");

                entity.ToTable("ContractInfo");

                entity.Property(e => e.ContractId)
                    .HasMaxLength(100)
                    .HasColumnName("contractId");

                entity.Property(e => e.BuildingArea)
                    .HasMaxLength(50)
                    .HasColumnName("buildingArea");

                entity.Property(e => e.BuildingType)
                    .HasMaxLength(1000)
                    .HasColumnName("buildingType");

                entity.Property(e => e.ClientId)
                    .HasMaxLength(100)
                    .HasColumnName("clientId");

                entity.Property(e => e.ContractName)
                    .HasMaxLength(100)
                    .HasColumnName("contractName");

                entity.Property(e => e.ContractNumber)
                    .HasMaxLength(100)
                    .HasColumnName("contractNumber");

                entity.Property(e => e.ContractRateState).HasColumnName("contractRateState");

                entity.Property(e => e.ContractRemarks)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("contractRemarks");

                entity.Property(e => e.ContractState)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("contractState");

                entity.Property(e => e.ContractType)
                    .HasMaxLength(100)
                    .HasColumnName("contractType");

                entity.Property(e => e.ContractextText)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("contractextText");

                entity.Property(e => e.CreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("createTime");

                entity.Property(e => e.Development)
                    .HasMaxLength(100)
                    .HasColumnName("development");

                entity.Property(e => e.DrawingNum)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("drawingNum");

                entity.Property(e => e.FloorNum)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("floorNum");

                entity.Property(e => e.GetDrawingNum)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("getDrawingNum");

                entity.Property(e => e.GetFloorNum)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("getFloorNum");

                entity.Property(e => e.OriginalContractPrice)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("originalContractPrice");

                entity.Property(e => e.OwnerDirector)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("ownerDirector");

                entity.Property(e => e.OwnerType)
                    .HasMaxLength(100)
                    .HasColumnName("ownerType");

                entity.Property(e => e.ProjectDirector)
                    .HasMaxLength(100)
                    .HasColumnName("projectDirector");

                entity.Property(e => e.ProjectPlace)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("projectPlace");

                entity.Property(e => e.RealyContractPrice)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("realyContractPrice");

                entity.Property(e => e.StructuralstyleId)
                    .HasMaxLength(1000)
                    .HasColumnName("structuralstyleId");

                entity.Property(e => e.Subsidiary)
                    .HasMaxLength(50)
                    .HasColumnName("subsidiary");

                entity.Property(e => e.TelePhone1)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("telePhone1");

                entity.Property(e => e.TelePhone2)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("telePhone2");
            });

            modelBuilder.Entity<ContractDept>(entity =>
            {
                entity.ToTable("ContractDept");

                entity.Property(e => e.AimValue)
                    .HasMaxLength(50)
                    .IsUnicode(false);

                entity.Property(e => e.DeptId)
                    .HasMaxLength(50)
                    .IsUnicode(false);

                entity.Property(e => e.Month)
                    .HasMaxLength(50)
                    .IsUnicode(false);

                entity.Property(e => e.ReducedValue)
                    .HasMaxLength(50)
                    .IsUnicode(false);

                entity.Property(e => e.Target)
                    .HasMaxLength(50)
                    .IsUnicode(false);

                entity.Property(e => e.Year)
                    .HasMaxLength(50)
                    .IsUnicode(false);
            });

            modelBuilder.Entity<ContractrateInfo>(entity =>
            {
                entity.HasKey(e => e.ContractrateId)
                    .HasName("PK_CONTRACTRATEINFO");

                entity.ToTable("ContractrateInfo");

                entity.Property(e => e.ContractrateId)
                    .HasMaxLength(100)
                    .HasColumnName("contractrateId");

                entity.Property(e => e.ContractId)
                    .IsRequired()
                    .HasMaxLength(100)
                    .HasColumnName("contractId");

                entity.Property(e => e.PayeeName)
                    .HasMaxLength(100)
                    .HasColumnName("payeeName");

                entity.Property(e => e.ProceedsTime)
                    .HasColumnType("datetime")
                    .HasColumnName("proceedsTime");

                entity.Property(e => e.RealyProceeds)
                    .HasColumnType("decimal(18, 0)")
                    .HasColumnName("realyProceeds");

                entity.Property(e => e.Remark)
                    .HasMaxLength(1000)
                    .HasColumnName("remark");
            });

            modelBuilder.Entity<Customer>(entity =>
            {
                entity.HasKey(e => e.CustId);

                entity.ToTable("Customer");

                entity.Property(e => e.CustId)
                    .HasMaxLength(50)
                    .HasColumnName("custId");

                entity.Property(e => e.CustAbbreviation)
                    .HasMaxLength(50)
                    .HasColumnName("custAbbreviation");

                entity.Property(e => e.CustAddress)
                    .HasMaxLength(50)
                    .HasColumnName("custAddress");

                entity.Property(e => e.CustEmail)
                    .HasMaxLength(50)
                    .HasColumnName("custEmail");

                entity.Property(e => e.CustFaxNumber)
                    .HasMaxLength(50)
                    .HasColumnName("custFaxNumber");

                entity.Property(e => e.CustName)
                    .HasMaxLength(50)
                    .HasColumnName("custName");

                entity.Property(e => e.CustPhone)
                    .HasMaxLength(50)
                    .HasColumnName("custPhone");

                entity.Property(e => e.CustPhones)
                    .HasMaxLength(50)
                    .HasColumnName("custPhones");

                entity.Property(e => e.DepartmentId)
                    .HasMaxLength(50)
                    .HasColumnName("departmentId");
            });

            modelBuilder.Entity<Department>(entity =>
            {
                entity.HasKey(e => e.DepId)
                    .HasName("PK_DEPARTMENT");

                entity.ToTable("Department");

                entity.Property(e => e.DepId).HasColumnName("depId");

                entity.Property(e => e.DepDescribe)
                    .HasMaxLength(20)
                    .IsUnicode(false)
                    .HasColumnName("depDescribe")
                    .IsFixedLength(true);

                entity.Property(e => e.DepHide).HasColumnName("depHide");

                entity.Property(e => e.DepName)
                    .HasMaxLength(20)
                    .IsUnicode(false)
                    .HasColumnName("depName")
                    .IsFixedLength(true);

                entity.Property(e => e.DepSort).HasColumnName("depSort");

                entity.Property(e => e.DepSuperior).HasColumnName("depSuperior");

                entity.Property(e => e.DepType).HasColumnName("depType");
            });

            modelBuilder.Entity<Dictionary>(entity =>
            {
                entity.HasKey(e => e.DicId)
                    .HasName("PK_DICTIONARIES");

                entity.Property(e => e.DicId).HasColumnName("dicId");

                entity.Property(e => e.DicCode)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("dicCode");

                entity.Property(e => e.DicDesc)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("dicDesc");

                entity.Property(e => e.DicName)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("dicName");
            });
            modelBuilder.Entity<DeptContract>(entity =>
            {
                entity.ToTable("DeptContract");

                entity.Property(e => e.Id).HasColumnName("id");

                entity.Property(e => e.DepName)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("depName");

                entity.Property(e => e.DeptId)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("deptId");

                entity.Property(e => e.HtId)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("htId");

                entity.Property(e => e.Wcbl)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("wcbl");

                entity.Property(e => e.Year)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("year");
            });

            modelBuilder.Entity<Extended>(entity =>
            {
                entity.HasKey(e => e.EdId);

                entity.ToTable("Extended");

                entity.Property(e => e.EdId)
                    .HasMaxLength(50)
                    .HasColumnName("edId");

                entity.Property(e => e.CustomerId)
                    .HasMaxLength(50)
                    .HasColumnName("customerId");

                entity.Property(e => e.EdBankAccount)
                    .HasMaxLength(50)
                    .HasColumnName("edBankAccount");

                entity.Property(e => e.EdBankName)
                    .HasMaxLength(50)
                    .HasColumnName("edBankName");

                entity.Property(e => e.EdBeiZhu)
                    .HasMaxLength(50)
                    .HasColumnName("edBeiZhu");

                entity.Property(e => e.EdBuMen)
                    .HasMaxLength(50)
                    .HasColumnName("edBuMen");

                entity.Property(e => e.EdCountryId1)
                    .HasMaxLength(50)
                    .HasColumnName("edCountryId1");

                entity.Property(e => e.EdCountryId2)
                    .HasMaxLength(50)
                    .HasColumnName("edCountryId2");

                entity.Property(e => e.EdCountryId3)
                    .HasMaxLength(50)
                    .HasColumnName("edCountryId3");

                entity.Property(e => e.EdCreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("edCreateTime");

                entity.Property(e => e.EdEmail)
                    .HasMaxLength(50)
                    .HasColumnName("edEmail");

                entity.Property(e => e.EdEnterprise)
                    .HasMaxLength(50)
                    .HasColumnName("edEnterprise");

                entity.Property(e => e.EdIndustryId)
                    .HasMaxLength(50)
                    .HasColumnName("edIndustryId");

                entity.Property(e => e.EdIsheZuo)
                    .HasMaxLength(50)
                    .HasColumnName("edISHeZuo");

                entity.Property(e => e.EdName)
                    .HasMaxLength(50)
                    .HasColumnName("edName");

                entity.Property(e => e.EdTypeId)
                    .HasMaxLength(50)
                    .HasColumnName("edTypeId");
            });

            modelBuilder.Entity<InstantiationInfo>(entity =>
            {
                entity.HasKey(e => e.InstantiationId)
                    .HasName("PK__Instanti__38EAC8FE0114716D");

                entity.ToTable("InstantiationInfo");

                entity.Property(e => e.InstantiationId).ValueGeneratedNever();

                entity.Property(e => e.CurrentRoleName).HasMaxLength(100);

                entity.Property(e => e.CurrentStaffName).HasMaxLength(100);

                entity.Property(e => e.InstanCreateTime).HasColumnType("datetime");

                entity.Property(e => e.InstantiationState).HasMaxLength(100);

                entity.Property(e => e.NextRoleName).HasMaxLength(100);

                entity.Property(e => e.StartRoleName).HasMaxLength(100);

                entity.Property(e => e.StartStaffName).HasMaxLength(100);
            });

            modelBuilder.Entity<MenudInfo>(entity =>
            {
                entity.HasKey(e => e.MenudId)
                    .HasName("PK__MenudInf__5C75AB77A4197933");

                entity.ToTable("MenudInfo");

                entity.Property(e => e.MenudId)
                    .HasMaxLength(20)
                    .IsUnicode(false);

                entity.Property(e => e.MenudMenuId)
                    .HasMaxLength(20)
                    .IsUnicode(false);

                entity.Property(e => e.MenudName)
                    .HasMaxLength(20)
                    .IsUnicode(false);

                entity.Property(e => e.MenudWebName)
                    .HasMaxLength(100)
                    .IsUnicode(false);
            });

            modelBuilder.Entity<NodeInfo>(entity =>
            {
                entity.HasKey(e => e.NodeId)
                    .HasName("PK__NodeInfo__6BAE226310E761CD");

                entity.ToTable("NodeInfo");

                entity.Property(e => e.NodeId).ValueGeneratedNever();

                entity.Property(e => e.LastNode).HasMaxLength(100);

                entity.Property(e => e.NextNode).HasMaxLength(100);

                entity.Property(e => e.NodeCreateTime).HasColumnType("datetime");

                entity.Property(e => e.NodeNumber).HasMaxLength(100);

                entity.Property(e => e.StaffName).HasMaxLength(100);
            });


            modelBuilder.Entity<Person>(entity =>
            {
                entity.ToTable("Person");

                entity.Property(e => e.PersonId)
                    .HasMaxLength(50)
                    .HasColumnName("personId");

                entity.Property(e => e.CustomerId)
                    .HasMaxLength(50)
                    .HasColumnName("customerId");

                entity.Property(e => e.PersonBeiZhu)
                    .HasMaxLength(50)
                    .HasColumnName("personBeiZhu");

                entity.Property(e => e.PersonBuMen)
                    .HasMaxLength(50)
                    .HasColumnName("personBuMen");

                entity.Property(e => e.PersonEmail)
                    .HasMaxLength(50)
                    .HasColumnName("personEmail");

                entity.Property(e => e.PersonNmae)
                    .HasMaxLength(50)
                    .HasColumnName("personNmae");

                entity.Property(e => e.PersonPhone)
                    .HasMaxLength(50)
                    .HasColumnName("personPhone");

                entity.Property(e => e.PersonShangWuC)
                    .HasMaxLength(50)
                    .HasColumnName("personShangWuC");

                entity.Property(e => e.PersonShangWuD)
                    .HasMaxLength(50)
                    .HasColumnName("personShangWuD");

                entity.Property(e => e.PersonZhiWu)
                    .HasMaxLength(50)
                    .HasColumnName("personZhiWu");

                entity.Property(e => e.PersonZhuZhaiC)
                    .HasMaxLength(50)
                    .HasColumnName("personZhuZhaiC");
            });

            modelBuilder.Entity<Personne>(entity =>
            {
                entity.HasNoKey();

                entity.ToTable("Personne");

                entity.Property(e => e.AssessmentId)
                    .HasMaxLength(50)
                    .HasColumnName("Assessment_id");

                entity.Property(e => e.DepartmentId)
                    .HasMaxLength(50)
                    .HasColumnName("Department_id");

                entity.Property(e => e.PersonnelDianqi)
                    .HasMaxLength(50)
                    .HasColumnName("Personnel_dianqi");

                entity.Property(e => e.PersonnelId)
                    .HasMaxLength(50)
                    .HasColumnName("Personnel_id");

                entity.Property(e => e.PersonnelJianzhu)
                    .HasMaxLength(50)
                    .HasColumnName("Personnel_jianzhu");

                entity.Property(e => e.PersonnelJianzhushi)
                    .HasMaxLength(50)
                    .HasColumnName("Personnel_jianzhushi");

                entity.Property(e => e.PersonnelJiegou)
                    .HasMaxLength(50)
                    .HasColumnName("Personnel_jiegou");

                entity.Property(e => e.PersonnelNuantong)
                    .HasMaxLength(50)
                    .HasColumnName("Personnel_nuantong");

                entity.Property(e => e.PersonnelPaishui)
                    .HasMaxLength(50)
                    .HasColumnName("Personnel_paishui");

                entity.Property(e => e.PersonnelZhuci)
                    .HasMaxLength(50)
                    .HasColumnName("Personnel_zhuci");
            });

            modelBuilder.Entity<Personnel>(entity =>
            {
                entity.Property(e => e.PersonnelId).ValueGeneratedNever();

                entity.Property(e => e.DepartureTime).HasColumnType("date");

                entity.Property(e => e.DesignTitle)
                    .HasMaxLength(20)
                    .IsUnicode(false);

                entity.Property(e => e.EntryTime).HasColumnType("date");

                entity.Property(e => e.HeadPortrait)
                    .HasMaxLength(20)
                    .IsUnicode(false);

                entity.Property(e => e.JobStatus)
                    .HasMaxLength(20)
                    .IsUnicode(false);

                entity.Property(e => e.PersonneIbir)
                    .HasColumnType("date")
                    .HasColumnName("PersonneIBir");

                entity.Property(e => e.PersonneIcontact)
                    .HasMaxLength(20)
                    .IsUnicode(false)
                    .HasColumnName("PersonneIContact");

                entity.Property(e => e.PersonneImailbox)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("PersonneIMailbox");

                entity.Property(e => e.PersonneImajor).HasColumnName("PersonneIMajor");

                entity.Property(e => e.PersonneIpassword)
                    .HasMaxLength(20)
                    .IsUnicode(false)
                    .HasColumnName("PersonneIPassword");

                entity.Property(e => e.PersonneIphone)
                    .HasMaxLength(20)
                    .IsUnicode(false)
                    .HasColumnName("PersonneIPhone");

                entity.Property(e => e.PersonneIroleId).HasColumnName("PersonneIRoleId");

                entity.Property(e => e.PersonneIsix).HasColumnName("PersonneISix");

                entity.Property(e => e.PersonneIsort).HasColumnName("PersonneISort");

                entity.Property(e => e.PersonnelName)
                    .HasMaxLength(20)
                    .IsUnicode(false);

                entity.Property(e => e.PersonnelUserName)
                    .HasMaxLength(20)
                    .IsUnicode(false);

                entity.Property(e => e.Subjection)
                    .HasMaxLength(20)
                    .IsUnicode(false);
            });

            modelBuilder.Entity<ProCon>(entity =>
            {
                entity.ToTable("ProCon");
            });

            modelBuilder.Entity<Project>(entity =>
            {
                entity.ToTable("Project");

                entity.Property(e => e.ProjectId)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("projectId");

                entity.Property(e => e.ProjectBuildtype)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("projectBuildtype");

                entity.Property(e => e.ProjectConId)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("projectConId");

                entity.Property(e => e.ProjectDeptId)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("projectDeptID");

                entity.Property(e => e.ProjectEndTime)
                    .HasColumnType("datetime")
                    .HasColumnName("projectEndTime");

                entity.Property(e => e.ProjectImage)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("projectImage");

                entity.Property(e => e.ProjectLevel)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("projectLevel");

                entity.Property(e => e.ProjectName)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("projectName");

                entity.Property(e => e.ProjectPhone)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("projectPhone");

                entity.Property(e => e.ProjectPrice)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("projectPrice");

                entity.Property(e => e.ProjectRid)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("projectRId");

                entity.Property(e => e.ProjectScale)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("projectScale");

                entity.Property(e => e.ProjectStage)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("projectStage");

                entity.Property(e => e.ProjectStartTime)
                    .HasColumnType("datetime")
                    .HasColumnName("projectStartTime");
            });

            modelBuilder.Entity<ProjectType>(entity =>
            {
                entity.ToTable("ProjectType");

                entity.Property(e => e.ProjectTypeId).HasColumnName("projectTypeId");

                entity.Property(e => e.ProjectTypeName)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("projectTypeName");

                entity.Property(e => e.Quarter1).HasColumnName("quarter1");

                entity.Property(e => e.Quarter2).HasColumnName("quarter2");

                entity.Property(e => e.Quarter3).HasColumnName("quarter3");

                entity.Property(e => e.Quarter4).HasColumnName("quarter4");
            });

            modelBuilder.Entity<ProjectDuibi>(entity =>
            {
                entity.ToTable("ProjectDuibi");
                entity.Property(e => e.Id).HasColumnName("id");
                entity.Property(e => e.DepeId).HasColumnName("depeId");

                entity.Property(e => e.Gj).HasColumnName("gj");

                entity.Property(e => e.Fdc).HasColumnName("fdc");

                entity.Property(e => e.Sz).HasColumnName("sz");

                entity.Property(e => e.Zh).HasColumnName("zh");

                entity.Property(e => e.Hj).HasColumnName("hj");
            });

            modelBuilder.Entity<RecordInfo>(entity =>
            {
                entity.HasKey(e => e.RecordId)
                    .HasName("PK__RecordIn__FBDF78E9B7C32F4F");

                entity.ToTable("RecordInfo");

                entity.Property(e => e.RecordId).ValueGeneratedNever();

                entity.Property(e => e.NodeNumber).HasMaxLength(100);

                entity.Property(e => e.RecordRoleName).HasMaxLength(100);

                entity.Property(e => e.RecordStaffName).HasMaxLength(100);

                entity.Property(e => e.RecordTime).HasColumnType("datetime");
            });

            modelBuilder.Entity<RequestInfo>(entity =>
            {
                entity.ToTable("RequestInfo");

                entity.Property(e => e.RequestInfoId).ValueGeneratedNever();

                entity.Property(e => e.BeginTime).HasColumnType("datetime");

                entity.Property(e => e.EndTime).HasColumnType("datetime");

                entity.Property(e => e.Place).HasMaxLength(500);

                entity.Property(e => e.Reason).HasMaxLength(500);

                entity.Property(e => e.RequestRemark).HasMaxLength(100);

                entity.Property(e => e.RequestType).HasMaxLength(100);
            });

            modelBuilder.Entity<RoleMenud>(entity =>
            {
                entity.HasKey(e => new { e.Rid, e.Mid })
                    .HasName("PK__Role_Men__F6893646A30B688F");

                entity.ToTable("Role_Menud");

                entity.Property(e => e.Rid)
                    .HasMaxLength(450)
                    .IsUnicode(false);

                entity.Property(e => e.Mid)
                    .HasMaxLength(20)
                    .IsUnicode(false);
            });

            modelBuilder.Entity<Roleinfo>(entity =>
            {
                entity.HasNoKey();

                entity.ToTable("Roleinfo");

                entity.Property(e => e.RoleNmae)
                    .HasMaxLength(20)
                    .IsUnicode(false);
            });

            modelBuilder.Entity<Satisfaction>(entity =>
            {
                entity.HasKey(e => e.SaId);

                entity.ToTable("Satisfaction");

                entity.Property(e => e.SaId)
                    .HasMaxLength(50)
                    .HasColumnName("saId");

                entity.Property(e => e.CustomerId)
                    .HasMaxLength(50)
                    .HasColumnName("customerId");

                entity.Property(e => e.SaBeiZhu)
                    .HasMaxLength(50)
                    .HasColumnName("saBeiZhu");

                entity.Property(e => e.SaManYi)
                    .HasMaxLength(50)
                    .HasColumnName("saManYi");

                entity.Property(e => e.SaMethodId)
                    .HasMaxLength(50)
                    .HasColumnName("saMethodId");

                entity.Property(e => e.SaNeiRong)
                    .HasMaxLength(50)
                    .HasColumnName("saNeiRong");

                entity.Property(e => e.SaTime)
                    .HasMaxLength(50)
                    .HasColumnName("saTime");
            });

            modelBuilder.Entity<StructuralstyleInfo>(entity =>
            {
                entity.HasKey(e => e.StructuralstyleId)
                    .HasName("PK__Structur__B6D332660DD7DFDD");

                entity.ToTable("StructuralstyleInfo");

                entity.Property(e => e.StructuralstyleId)
                    .ValueGeneratedNever()
                    .HasColumnName("structuralstyleId");

                entity.Property(e => e.PId).HasColumnName("pId");

                entity.Property(e => e.Structuralstyle)
                    .HasMaxLength(100)
                    .HasColumnName("structuralstyle");
            });

            modelBuilder.Entity<UserRole>(entity =>
            {
                entity.HasKey(e => new { e.PersonnelId, e.RoleId })
                    .HasName("PK__User_Rol__725467AE686A8B6F");

                entity.ToTable("User_Role");

                entity.Property(e => e.PersonnelId)
                    .HasMaxLength(450)
                    .IsUnicode(false);

                entity.Property(e => e.RoleId)
                    .HasMaxLength(450)
                    .IsUnicode(false);
            });

            modelBuilder.Entity<NPer>(entity =>
            {
                entity.HasKey(e => new { e.Nid, e.PersonnelIda, e.PersonnelIdb })
                    .HasName("PK__N_Per__D7CD2FB73354413C");

                entity.ToTable("N_Per");

                entity.Property(e => e.PersonnelIda)
                    .HasMaxLength(200)
                    .IsUnicode(false);

                entity.Property(e => e.PersonnelIdb)
                    .HasMaxLength(200)
                    .IsUnicode(false);
            });

            modelBuilder.Entity<Notice>(entity =>
            {
                entity.HasKey(e => e.Nid)
                    .HasName("PK__Notice__C7D1D6CBEA13364B");

                entity.ToTable("Notice");

                entity.Property(e => e.Ntime)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("(getdate())");

                entity.Property(e => e.Ntitel)
                    .HasMaxLength(50)
                    .IsUnicode(false);

                entity.Property(e => e.Ntxt)
                    .IsUnicode(false)
                    .HasColumnName("NTxt");
            });

            modelBuilder.Entity<HolidaysInfo>(entity =>
            {
                entity.HasKey(e => e.HoldayId)
                    .HasName("PK__Holidays__124EE2578BFFC5C1");

                entity.ToTable("HolidaysInfo");

                entity.Property(e => e.HoldayId).HasColumnName("HoldayID");

                entity.Property(e => e.Holday).HasColumnType("date");
            });

            modelBuilder.Entity<WorkdayInfo>(entity =>
            {
                entity.HasKey(e => e.WorkdayId)
                    .HasName("PK__WorkdayI__3103DD68804CDC63");

                entity.ToTable("WorkdayInfo");

                entity.Property(e => e.WorkdayId).HasColumnName("WorkdayID");

                entity.Property(e => e.Workday).HasColumnType("date");
            });

            OnModelCreatingPartial(modelBuilder);
        }

        partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
    }
}